define(function(require,exports,module){
   'use strict';

    var React = require('reactAddons');

    module.exports = React.createClass({
        clickHandler:function(e){
            e.preventDefault();
            this.props.listData(e.currentTarget.dataset.page);
        },
        render:function(){
            var cx = React.addons.classSet;
            var preClass = cx({
                'previous':true,
                'disabled':this.props.pre_stop == true
            });
            var nextClass = cx({
                'next':true,
                'disabled':this.props.next_stop == true
            });

            return (
                <nav>
                    <ul className="pager">
                        <li className={preClass}>
                            <a href="#" onClick={this.clickHandler} data-page={this.props.page-1}>
                                <span aria-hidden="true" >&larr;</span> Older
                            </a>
                        </li>
                        <li className={nextClass}>
                            <a href="#" onClick={this.clickHandler} data-page={this.props.page+1}>
                                Newer <span aria-hidden="true">&rarr;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            );
        }
    });

});